package com.unism.unisdk.core.transport;

import java.lang.reflect.Type;
import java.util.List;

import com.unism.unisdk.common.OpenAPI;
import com.unism.unisdk.common.enumObj.HttpMethod;
import com.unism.unisdk.common.enumObj.Location;

public class ApiAttr {
	private String url;
	private HttpMethod httpMethod;
	private List<ApiParam> apiParams;
	private ReturnClass returnClass;
	private String resultJsonKey;
	private int requestTimeout;

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public HttpMethod getHttpMethod() {
		return this.httpMethod;
	}

	public void setHttpMethod(HttpMethod httpMethod) {
		this.httpMethod = httpMethod;
	}

	public List<ApiParam> getApiParams() {
		return this.apiParams;
	}

	public void setApiParams(List<ApiParam> apiParams) {
		this.apiParams = apiParams;
	}

	public ReturnClass getReturnClass() {
		return this.returnClass;
	}

	public void setReturnClass(ReturnClass returnClass) {
		this.returnClass = returnClass;
	}

	public String getResultJsonKey() {
		return this.resultJsonKey;
	}

	public void setResultJsonKey(String resultJsonKey) {
		this.resultJsonKey = resultJsonKey;
	}
	public int getRequestTimeout() {
		return this.requestTimeout;
	}

	public void setRequestTimeout(int requestTimeout) {
		this.requestTimeout = requestTimeout;
	}

	public static class ReturnClass {
		private boolean isGeneric;
		private Class<?> clazz;
        private Type type;
		public boolean isGeneric() {
			return isGeneric;
		}
		public void setGeneric(boolean isGeneric) {
			this.isGeneric = isGeneric;
		}

		public Type getType() {
			return type;
		}

		public void setType(Type type) {
			this.type = type;
		}

		public Class<?> getClazz() {
			return this.clazz;
		}

		public void setClazz(Class<?> clazz) {
			this.clazz = clazz;
		}
	}

	public static class ApiParam {
		private int index;
		private Location location;
		private String key;

		public int getIndex() {
			return this.index;
		}

		public void setIndex(int index) {
			this.index = index;
		}

		public Location getLocation() {
			return this.location;
		}

		public void setLocation(Location location) {
			this.location = location;
		}

		public String getKey() {
			return this.key;
		}

		public void setKey(String key) {
			this.key = key;
		}
	}
}